<template>
  <div class="live">
    <Header title="病例分享" />
    <div class="item" v-for="(item,index) in data.msg" :key="index">
      <div class="left">
        <p :class="item.status===0?'title half':'title line'">{{ item.title }}</p>
        <p>
          <span :class="item.status===0?'finished':'processing'">
            {{ item.status===0?'已结束':'进行中' }}
          </span>
          <span class="guest">嘉宾：{{item.guest}}</span>
        </p>
      </div>
      <div class="right" v-if="item.endPic">
        <img src="../../../assets/img/s2.webp">
      </div>
    </div>
  </div>
</template>

<script>

// 病例分享
import Header from './Header' 
import {reactive} from 'vue'
export default {
  name: 'Hotlive',
  components:{
      Header
  },
  setup(){
    const data = reactive({
      msg:[
        {
          title: '假肥大性肌营养不良的病例分享文案-边界测试处理中级超出部分',
          status: 1,
          guest: '王楚楚',
          endPic: '',
        },
        {
          title: '假肥大性肌营养不良的病例分享-边界测试处理中级超出部分',
          status: 0,
          guest: '王楚楚',
          endPic: '../../assets/img/s2.webp',
        },
        {
          title: '假肥大性肌营养不良的病例分享-边界测试处理中级超出部分',
          status: 0,
          guest: '郑州大学第一附属医院-梗迪',
          endPic: '../../assets/img/s2.webp',
        },
      ]
    })
    return {
      data
    }
  }
   
  
}
</script>

<style lang="scss" scoped>
.live{
  display: flex;
  flex-direction: column;
  align-items: center;
  .item{
    width: 34.5rem;
    height: 6.1rem;
    background: #fff;
    box-shadow: 0 .5rem 1rem 0 rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .8rem;
    box-sizing: border-box;
    padding-left: 1.6rem;
    .left{
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      .title{   
        font-size: 1.4rem;
        font-weight: 500;
        color: #000;
        letter-spacing: 0;
        padding: .5rem 0;
        overflow: hidden;
        text-overflow:ellipsis;
        white-space: nowrap;
        text-align: left;
        // border: 1px solid red;
        .span{
          font-size: 1rem;
          font-weight: 400;
          color: #0057FF;
        }
      }
      .guest{
        font-size: 1rem;
        font-weight: 400;
        color: #999;
        margin-left: 1.1rem;
      }
    } 
    .right{
      img{
        width: 6.8rem;
        height: 3.8rem;
        margin-right: 2.2rem;
      }
    }
  }
}
// 动态判断的状态
.finished {
  color: #0057FF;
}
.processing {
  color: #CF0000;
}
// 文本框的宽度
.half{
  width: 23.5rem;
}
.line{
  width: 32rem;
}
</style>
